#include"ThreadPool.hpp"
#include"Task.hpp"
#include"Log.hpp"

int main()
{
    //Log lg;
    // lg.Enable(FILE_TYPE);
    //lg.LogMessage(__FILE__,__LINE__,DEBUG,"hello:%d ,world:%c ,hello:%f\n",3,'A',3.14);

    // LOG(DEBUG,"hello:%d ,world:%c ,hello:%f\n",3,'A',3.14);//使用了宏替换
    // LOG(DEBUG,"hello world\n");
    
 
    // ThreadPool<Task> *tp=new ThreadPool<Task>();
    // tp->Init();
    // tp->Start();
    EnableFile();
    int cnt=10;
    while(cnt--)
    {
        sleep(1);
        Task t(1,1);
        ThreadPool<Task>::GetInstand()->Equeue(t);
        // sleep(1);
        LOG(INFO,"Equeue a task %s\n",t.Debug().c_str());
    }
    ThreadPool<Task>::GetInstand()->Stop();
    sleep(2);
    //LOG(INFO,"threadpool stop\n");
    return 0;
}